.class public Lde/dealdoktor/app/activities/Comments;
.super Landroid/app/Activity;
.source "Comments.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lde/dealdoktor/app/activities/Comments$GetCommentsTask;
    }
.end annotation


# instance fields
.field private broadcastReceiver:Landroid/content/BroadcastReceiver;

.field private commentsList:Landroid/widget/ListView;

.field private commentsPage:I

.field private isLoading:Z

.field private listAdapter:Lde/dealdoktor/app/adapter/CommentsListAdapter;

.field private loadingView:Landroid/view/View;

.field private posts:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lde/dealdoktor/app/data/PostDAO;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 26
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    .line 28
    const/4 v0, 0x1

    iput v0, p0, Lde/dealdoktor/app/activities/Comments;->commentsPage:I

    .line 29
    const/4 v0, 0x0

    iput-boolean v0, p0, Lde/dealdoktor/app/activities/Comments;->isLoading:Z

    .line 34
    new-instance v0, Lde/dealdoktor/app/activities/Comments$1;

    invoke-direct {v0, p0}, Lde/dealdoktor/app/activities/Comments$1;-><init>(Lde/dealdoktor/app/activities/Comments;)V

    iput-object v0, p0, Lde/dealdoktor/app/activities/Comments;->broadcastReceiver:Landroid/content/BroadcastReceiver;

    .line 26
    return-void
.end method

.method static synthetic access$0(Lde/dealdoktor/app/activities/Comments;)V
    .locals 0
    .parameter

    .prologue
    .line 162
    invoke-direct {p0}, Lde/dealdoktor/app/activities/Comments;->refresh()V

    return-void
.end method

.method static synthetic access$1(Lde/dealdoktor/app/activities/Comments;Z)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 29
    iput-boolean p1, p0, Lde/dealdoktor/app/activities/Comments;->isLoading:Z

    return-void
.end method

.method static synthetic access$2(Lde/dealdoktor/app/activities/Comments;)Ljava/util/ArrayList;
    .locals 1
    .parameter

    .prologue
    .line 27
    iget-object v0, p0, Lde/dealdoktor/app/activities/Comments;->posts:Ljava/util/ArrayList;

    return-object v0
.end method

.method static synthetic access$3(Lde/dealdoktor/app/activities/Comments;)I
    .locals 1
    .parameter

    .prologue
    .line 28
    iget v0, p0, Lde/dealdoktor/app/activities/Comments;->commentsPage:I

    return v0
.end method

.method static synthetic access$4(Lde/dealdoktor/app/activities/Comments;I)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 28
    iput p1, p0, Lde/dealdoktor/app/activities/Comments;->commentsPage:I

    return-void
.end method

.method static synthetic access$5(Lde/dealdoktor/app/activities/Comments;)Lde/dealdoktor/app/adapter/CommentsListAdapter;
    .locals 1
    .parameter

    .prologue
    .line 30
    iget-object v0, p0, Lde/dealdoktor/app/activities/Comments;->listAdapter:Lde/dealdoktor/app/adapter/CommentsListAdapter;

    return-object v0
.end method

.method static synthetic access$6(Lde/dealdoktor/app/activities/Comments;)Z
    .locals 1
    .parameter

    .prologue
    .line 29
    iget-boolean v0, p0, Lde/dealdoktor/app/activities/Comments;->isLoading:Z

    return v0
.end method

.method static synthetic access$7(Lde/dealdoktor/app/activities/Comments;)Landroid/view/View;
    .locals 1
    .parameter

    .prologue
    .line 32
    iget-object v0, p0, Lde/dealdoktor/app/activities/Comments;->loadingView:Landroid/view/View;

    return-object v0
.end method

.method static synthetic access$8(Lde/dealdoktor/app/activities/Comments;Ljava/util/ArrayList;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 27
    iput-object p1, p0, Lde/dealdoktor/app/activities/Comments;->posts:Ljava/util/ArrayList;

    return-void
.end method

.method private refresh()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    .line 163
    sput-boolean v1, Lde/dealdoktor/app/App;->updateComments:Z

    .line 164
    const/4 v0, 0x1

    iput v0, p0, Lde/dealdoktor/app/activities/Comments;->commentsPage:I

    .line 165
    iget-object v0, p0, Lde/dealdoktor/app/activities/Comments;->listAdapter:Lde/dealdoktor/app/adapter/CommentsListAdapter;

    invoke-virtual {v0}, Lde/dealdoktor/app/adapter/CommentsListAdapter;->clear()V

    .line 166
    iget-object v0, p0, Lde/dealdoktor/app/activities/Comments;->listAdapter:Lde/dealdoktor/app/adapter/CommentsListAdapter;

    invoke-virtual {v0}, Lde/dealdoktor/app/adapter/CommentsListAdapter;->notifyDataSetChanged()V

    .line 167
    new-instance v0, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;

    invoke-direct {v0, p0}, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;-><init>(Lde/dealdoktor/app/activities/Comments;)V

    new-array v1, v1, [Ljava/lang/String;

    invoke-virtual {v0, v1}, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    .line 168
    return-void
.end method


# virtual methods
.method public onClickLoadComments(Landroid/view/View;)V
    .locals 2
    .parameter "v"

    .prologue
    .line 138
    iget v0, p0, Lde/dealdoktor/app/activities/Comments;->commentsPage:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Lde/dealdoktor/app/activities/Comments;->commentsPage:I

    .line 139
    new-instance v0, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;

    invoke-direct {v0, p0}, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;-><init>(Lde/dealdoktor/app/activities/Comments;)V

    const/4 v1, 0x0

    new-array v1, v1, [Ljava/lang/String;

    invoke-virtual {v0, v1}, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    .line 140
    return-void
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 3
    .parameter "savedInstanceState"

    .prologue
    .line 43
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 44
    const v1, 0x7f030002

    invoke-virtual {p0, v1}, Lde/dealdoktor/app/activities/Comments;->setContentView(I)V

    .line 46
    const-string v1, "layout_inflater"

    invoke-virtual {p0, v1}, Lde/dealdoktor/app/activities/Comments;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/LayoutInflater;

    .line 47
    .local v0, infl:Landroid/view/LayoutInflater;
    const v1, 0x7f030013

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v1

    iput-object v1, p0, Lde/dealdoktor/app/activities/Comments;->loadingView:Landroid/view/View;

    .line 50
    const v1, 0x7f0b0005

    invoke-virtual {p0, v1}, Lde/dealdoktor/app/activities/Comments;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/ListView;

    iput-object v1, p0, Lde/dealdoktor/app/activities/Comments;->commentsList:Landroid/widget/ListView;

    .line 53
    iget-object v1, p0, Lde/dealdoktor/app/activities/Comments;->commentsList:Landroid/widget/ListView;

    iget-object v2, p0, Lde/dealdoktor/app/activities/Comments;->loadingView:Landroid/view/View;

    invoke-virtual {v1, v2}, Landroid/widget/ListView;->addFooterView(Landroid/view/View;)V

    .line 56
    iget-object v1, p0, Lde/dealdoktor/app/activities/Comments;->commentsList:Landroid/widget/ListView;

    new-instance v2, Lde/dealdoktor/app/activities/Comments$2;

    invoke-direct {v2, p0}, Lde/dealdoktor/app/activities/Comments$2;-><init>(Lde/dealdoktor/app/activities/Comments;)V

    invoke-virtual {v1, v2}, Landroid/widget/ListView;->setOnScrollListener(Landroid/widget/AbsListView$OnScrollListener;)V

    .line 74
    new-instance v1, Lde/dealdoktor/app/adapter/CommentsListAdapter;

    invoke-direct {v1, p0}, Lde/dealdoktor/app/adapter/CommentsListAdapter;-><init>(Lde/dealdoktor/app/activities/Comments;)V

    iput-object v1, p0, Lde/dealdoktor/app/activities/Comments;->listAdapter:Lde/dealdoktor/app/adapter/CommentsListAdapter;

    .line 75
    iget-object v1, p0, Lde/dealdoktor/app/activities/Comments;->commentsList:Landroid/widget/ListView;

    iget-object v2, p0, Lde/dealdoktor/app/activities/Comments;->listAdapter:Lde/dealdoktor/app/adapter/CommentsListAdapter;

    invoke-virtual {v1, v2}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 77
    new-instance v1, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;

    invoke-direct {v1, p0}, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;-><init>(Lde/dealdoktor/app/activities/Comments;)V

    const/4 v2, 0x0

    new-array v2, v2, [Ljava/lang/String;

    invoke-virtual {v1, v2}, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    .line 79
    return-void
.end method

.method protected onPause()V
    .locals 1

    .prologue
    .line 158
    invoke-super {p0}, Landroid/app/Activity;->onPause()V

    .line 159
    iget-object v0, p0, Lde/dealdoktor/app/activities/Comments;->broadcastReceiver:Landroid/content/BroadcastReceiver;

    invoke-virtual {p0, v0}, Lde/dealdoktor/app/activities/Comments;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    .line 160
    return-void
.end method

.method protected onResume()V
    .locals 3

    .prologue
    .line 149
    invoke-super {p0}, Landroid/app/Activity;->onResume()V

    .line 150
    iget-object v0, p0, Lde/dealdoktor/app/activities/Comments;->broadcastReceiver:Landroid/content/BroadcastReceiver;

    new-instance v1, Landroid/content/IntentFilter;

    const-string v2, "de.dealdoktor.broadcastaction.update"

    invoke-direct {v1, v2}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0, v0, v1}, Lde/dealdoktor/app/activities/Comments;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    .line 151
    sget-boolean v0, Lde/dealdoktor/app/App;->updateComments:Z

    if-eqz v0, :cond_0

    .line 152
    invoke-direct {p0}, Lde/dealdoktor/app/activities/Comments;->refresh()V

    .line 154
    :cond_0
    return-void
.end method

.method public onSearchRequested()Z
    .locals 1

    .prologue
    .line 144
    invoke-virtual {p0}, Lde/dealdoktor/app/activities/Comments;->getParent()Landroid/app/Activity;

    move-result-object v0

    invoke-virtual {v0}, Landroid/app/Activity;->onSearchRequested()Z

    move-result v0

    return v0
.end method
